home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 007 / bled15.arc / BLED.DOC < prev    next >
Text File  |  1987-01-26  |  32KB  |  701 lines

  1.      DOCUMENTATION for BLED version 1.5
  2.      by Ken Goosens, 5020 Portsmouth Road, Fairfax, VA 22032
  3.      25 January 1987
  4.  
  5.      **********************************************************************
  6.      * BLED is copyrighted by its author.  BLED can be freely distributed *
  7.      * by non-profit organizations and bulletin boards.  BLED cannot be   *
  8.      * distributed commercially nor included in any commercial product    *
  9.      * with the explicit written consent of the author.  Individuals      *
  10.      * are encouraged to give free copies to other individuals.           *
  11.      *    All rights to the code are held by the author and any use       *
  12.      * or modification of the code requires permission of the author.     *
  13.      **********************************************************************
  14.  
  15.      BLED is supported by its author.  Individuals are encouraged to report
  16.      bugs, suggest enhancements, or, preferably, to make improvements to
  17.      the code available to others through the author.
  18.  
  19.      BLED should be distributed with the following files:
  20.  
  21.      BLED.DOC - this file
  22.      BLED.EXE - compiled, executable code
  23.      BLED.BAS - main program source code
  24.      UTILBLED.BAS - separately compiled subprograms used in BLED
  25.  
  26.      BLED uses assembler subroutines from the fine library ADVBAS by 
  27.      TOM HANLIN.  The author has paid Tom Hanlin for rights to use his
  28.      code.
  29.  
  30.      CONTENTS
  31.  
  32.      What is BLED
  33.      What Use is BLED
  34.      What are the Advantages of BLED
  35.      New Features of BLED
  36.      How Does BLED Work
  37.      How do you Identify Lines
  38.      Line Number Merging
  39.      How to Invoke BLED
  40.      How BLED Runs
  41.      The Major BLED Functions
  42.      CONFIGURE
  43.      FILE COMPARE
  44.      LINE MERGE
  45.      MERGE
  46.      Stylistic Considerations
  47.      How to Recompile BLED
  48.  
  49.      What is BLED
  50.  
  51.      BLED is  a Batch Line EDitor.  Editor - because it changes text files.
  52.      Line - because  it  operates  on  entire  lines  of  text  rather than
  53.      individual characters  or phrases.  And batch - because the changes to
  54.      be made are not  specified interactively,  but are  pre-specified in a
  55.      file describing the changes, which is created outside of BLED.
  56.  
  57.  
  58.      What Use is BLED?
  59.  
  60.      BLED is  most useful when different people have to communicate changes
  61.      to a text file that they jointly maintain.  The typical use of BLED is
  62.      for producing  modifications to source code for programs.  Interactive
  63.      Microsoft BASIC has long had  a  MERGE  command  which  functions like
  64.      BLED.  It  inserts, deletes, and replaces lines based on line numbers.
  65.      Other public domain programs  would  compare  two  BASIC  programs and
  66.      produce  a  merge  file  to  convert  one to the other using the merge
  67.      command.  BLED  is  a  generalized  program  that  combines  these two
  68.      functions.
  69.  
  70.  
  71.      What are the Advantages of BLED?
  72.  
  73.      o    Lines of text do not have to be numbered.
  74.  
  75.      This means  that BLED  will work with source code that allows lines of
  76.      code to have no  numbers, including  Mircosoft QuickBASIC,  as well as
  77.      Pascal and other languages.
  78.  
  79.      o    Comment lines are supported.
  80.  
  81.      BLED comment  lines are  completely ignored  when merging.  This means
  82.      that documentation  can be  included right  inside a  BLED merge file.
  83.      One of  the disadvantages of the BASIC merge command was that the only
  84.      type of line possible was BASIC  code,  so  that  documentation  for a
  85.      merge always had to be included in a separate file.
  86.  
  87.      o    Logical lines can span multiple physical lines.
  88.  
  89.      One of  the more  disagreeable features of old BASIC was that a single
  90.      line of code (i.e. a line beginning with a  number) had  to be  on one
  91.      physical   line.    Newer   languages   like   QuickBASIC   support  a
  92.      line-continuation character (e.g the underscore) that  allows the same
  93.      logical line  to span  multiple physical lines.  This greatly improves
  94.      the readability of source  code by  allowing grouping  by indentation.
  95.      BLED recognizes and supports logical lines.
  96.  
  97.      o    Can be run batch from DOS, or interactively.
  98.  
  99.      Commands telling  BLED what  to do  can be specified as DOS arguments,
  100.      and BLED has a batch mode in which it will run without further prompts
  101.      and return  automatically to  DOS.  BLED will prompt for any arguments
  102.      it needs which are not specified.
  103.  
  104.      o    Configurable.
  105.  
  106.      BLED comes pre-set to  work  with  Microsoft  QuickBASIC,  but  can be
  107.      configured to work with different languages.
  108.  
  109.  
  110.      New Features of BLED
  111.  
  112.      BLED 1.5 has two major enhancements, some bug fixes, and some
  113.      cosmetic changes.
  114.  
  115.     o   A new option to support preserving BLED comments.
  116.  
  117.      On a merge, BLED comment lines were always eliminated and there
  118.      was no way to put temporarily comments on changes as source code
  119.      comments.  Now there is a configuration parameter that will cause
  120.      BLED comment lines to be converted to a specially formatted source
  121.      code comment lines in a merge and, conversely, convert these special
  122.      source code comments to BLED comments when doing a file compare to
  123.      produce a merge.  This change allows programmers to work with equal
  124.      fecility with merges or directly on the full program and readily
  125.      document changes and yet easily remove these temporary comments
  126.      when the code is put into production.
  127.  
  128.          o   BLED is about 33% faster because it has been recompiled
  129.              under QUICKBASIC 2.0.
  130.  
  131.          o   The automatic documentation in a file compare has been
  132.              enhanced to include the date and file size of the old
  133.              version of the code so that there is no ambiguity about
  134.              what version of the code the new merge goes against.
  135.  
  136.          o   A bug has been fixed that caused the character used for
  137.              a source code remark not to be read in properly from a
  138.              configuration file.
  139.  
  140.          o   A bug has been fixed that caused the maximum number of
  141.              physical lines allowed in a logical line not to be read
  142.              in properly from a configuration file.
  143.  
  144.          o   Status line reports now use a mixture of upper and lower
  145.              case rather than all upper case.  This improves readability
  146.              and reserves all upper case words for special emphasis.
  147.  
  148.          o   When a file is missing and the proper name is entered,
  149.              the status line is now properly restored.
  150.  
  151.          o   When the user Quits in interactive mode, the cursor is
  152.              left at the bottom of the screen rather than in the middle
  153.              of previous text.
  154.  
  155.          o   A parameter has been added which was in the code but missing
  156.              from the documentation.  Other parts of the documentation
  157.              have been added or made more thorough, including a statement
  158.              of distribution rights and how to recompile BLED.
  159.  
  160.                            History of Other Changes
  161.  
  162.      BLED 1.4 has one major change.  Output is now internally buffered.
  163.      Before, every line was written out immediately.  Now up to 100 lines
  164.      are held internally before writing.  This dramatically reduces the
  165.      number of disk i/o's and reduces the head movement, usually making
  166.      the program faster.  My test showed a 12% improvement with RBBS.
  167.          The only other change is that the default maximum number of lines
  168.      between line numbers is now 400 rather than 200.
  169.  
  170.      BLED 1.3 fixes a bug.  If a line begins with a comment other than in
  171.      column 1 and ends with a line continuation character (e.g. source code
  172.      commented out), BLED would get not correctly identify the line as a
  173.      comment and would get an illegal function call.
  174.  
  175.      BLED 1.2 has two two features: (1) autodocumenting merge, and (2) test
  176.      run mode.
  177.  
  178.      AUTODOCUMENTING.   When you do a file compare to produce a merge, BLED
  179.      produces a  header on  what files were used to make the merge and date
  180.      and time stamps the merge.  Also, BLED  produces a  header comment for
  181.      each change indicating whether the line is being INSERTED, DELETED, or
  182.      REPLACED (changed).  Also, for replacement lines longer than one line,
  183.      BLED will insert a comment marking the first different line.
  184.  
  185.      TEST MODE.   There is a new "T" (for Test) parameter.  This limits the
  186.      run to a specificed number of logical lines in the  master file.   You
  187.      will not normally use this parameter.
  188.  
  189.  
  190.      How Does BLED Work?
  191.  
  192.      Like a  block editor.   Think of how you would work with a full screen
  193.      text editor, if you  had to  work from  the top  to the  bottom of the
  194.      file.  You basically do two things:
  195.  
  196.      o    Mark a block of lines.
  197.  
  198.      o    Say what  to do  with the block - either keep, delete, or replace
  199.           by another block of code; or insert a block of code.
  200.  
  201.      BLED has a BLOCK command to identify the block of text, followed  by a
  202.      disposition  command  of  KEEP,  DELETE,  REPLACE, or INSERT.  This is
  203.      BLED's general MERGE.
  204.  
  205.  
  206.      How do You Identify Lines?
  207.  
  208.      You have to specify what blocks of lines you want to work with.  There
  209.      are three ways.
  210.  
  211.      o    By physical line number.
  212.  
  213.      The  absolute  physical  line  numbers are 1,2,3,etc. for each line of
  214.      text.  Relative lines can also  be  specified,  e.g. from  the current
  215.      position in the file forward three lines.
  216.  
  217.      o    By line labels.
  218.  
  219.      Line labels  are identifiers  or names  for lines.  BLED supports both
  220.      numeric line labels (it calls  them  label  numbers)  and alphanumeric
  221.      labels (simply labels).  BLED ASSUMES THAT A LINE LABEL OCCURS ONLY AS
  222.      THE FIRST WORD ON A LINE.  Some  languages allow  labels to  be put in
  223.      the  middle  of  a  physical  line,  but  this is bad practice because
  224.      interior labels are hard to find.
  225.  
  226.      o    By strings.
  227.  
  228.      Strings are just sequences of characters that can occur inside lines.
  229.  
  230.      So, in BLED, a block can be identified as beginning or ending  with an
  231.      absolute or relative line number, a line label, or a string.  And so a
  232.      block can be defined as
  233.  
  234.           the first five lines
  235.           everything between label-1 and label-2
  236.           from line 50 to label-1
  237.           from label-1 to the line with "HELP" in it
  238.  
  239.  
  240.      Line Number Merging
  241.  
  242.      BLED also supports  a  more  specialized  merge  much  like  the BASIC
  243.      merge.  Details  are given  below.   This line merge mode is just like
  244.      the BASIC merge command except that  logical blocks  of physical lines
  245.      replace the single physical line, and comment lines are supported.
  246.  
  247.      BLED  supports   the  specialized   line  number   merge  because  the
  248.      assumptions  greatly  simplify  the  merge  files.   No  special  BLED
  249.      commands are required:  no blocks, no block dispositions.  To insert a
  250.      line, just give it a line  number between  the original  line numbers.
  251.      To delete,  put only  the line  number in the merge file.  To replace,
  252.      use the same line number.
  253.  
  254.      The BLED line number merge treats all lines between line  numbers as a
  255.      single block,  i.e. as  if they  are one  single logical line, even if
  256.      they are multiple physical  and logical  lines.   For example,  in the
  257.      BASIC code
  258.  
  259.                200 X = X+1
  260.                    IF X>5 THEN_
  261.                      Y=0
  262.                210 Y = Y+1
  263.  
  264.      you might  think that  you could  delete the  first line 200 by having
  265.      "200" alone in the merge.   In fact,  the first  three lines  would be
  266.      deleted rather than the first only.
  267.  
  268.  
  269.      How to Invoke BLED
  270.  
  271.      BLED is invoked at DOS by typing
  272.  
  273.          BLED[/options] [spec-1] [spec-2] [spec-3] [spec-4] [spec-5]
  274.          where a spec has the format [drive:][\path\][filename]
  275.  
  276.      Everything in  brackets is  optional and  may be omitted.  The options
  277.      after BLED are
  278.           /B   -    run batch.  Means to ask no questions and automatically
  279.                     return  to  DOS  when  done.   Must be used with one of
  280.                     following options and requires first three specs.
  281.  
  282.           /F   -    file compare.  Means to produce a merge file which will
  283.                     transform spec-1  (old version) into spec-2.  Output is
  284.                     spec-3.
  285.  
  286.           /L   -    line number merge.  Do a  merge of  spec-2 into spec-1,
  287.                     based  on   line  number  identifiers  in  both  files,
  288.                     outputting to spec-3.
  289.  
  290.           /M   -    general merge based  on  BLED  commands.    Into spec-1
  291.                     merge spec-2, producing spec-3.
  292.  
  293.           /T=XXX -  test mode.  Do not process all line from master (first)
  294.                     file.  Instead, end the  run  after  processing  XXX (a
  295.                     number)  of  logical  lines  in  the master file.  Used
  296.                     mainly for testing BLED.  So you can  run against large
  297.                     real files without having to create smaller samples.
  298.  
  299.      Note:  /F,/L,/M  options  are  incompatible  and  at  most  one can be
  300.      specified.  BLED checks  for consistency  and required  parameters and
  301.      will abort  with an  error message  and help.  Optional parameters not
  302.      specified at DOS are supplied using full screen prompts.
  303.  
  304.      Spec-4 is used when you want to override the default warning file name
  305.      (WARNING is the default configuration value).  BLED keeps appending to
  306.      the warning file as long as you continue to run within it.   Each time
  307.      you reenter  BLED from  DOS, however,  BLED will begin overwriting the
  308.      warning file.  The override is useful if you want to preserve previous
  309.      warning files.
  310.  
  311.      Spec-5  is  for  overriding  the  default  configuration  file name of
  312.      BLED.CFG.
  313.  
  314.      Note:  the meaning of the first three file specs is different  for the
  315.      /F option.  Merges mean
  316.  
  317.                [source file]  [merges]   [source+merge]
  318.  
  319.      But for the /F option the specs mean
  320.  
  321.                [old version]  [new version]  [merges]
  322.  
  323.  
  324.      How BLED Runs
  325.  
  326.      BLED makes  a single pass through the original file, doing comparisons
  327.      to the second file.  Therefor all references to line  labels should be
  328.      in the  same order they occur in the original file.  BLED gives an on-
  329.      screen status report of what it is doing,  the files  it is  using, as
  330.      well as  counts of  the number  of records  it reads and writes at the
  331.      bottom of the screen.
  332.  
  333.      The Major BLED Functions
  334.  
  335.      The four major BLED functions are
  336.  
  337.      o    CONFIGURE.  General configuration parameters.
  338.  
  339.      o    FILE COMPARE.  Create a merge file.
  340.  
  341.      o    LINE MERGE.  Merge based on line number labels.
  342.  
  343.      o    MERGE.  Merge using explicit  BLED  block  and  block disposition
  344.           commands.
  345.  
  346.      The main menu in BLED uses the first letter of each choice.
  347.  
  348.  
  349.      CONFIGURE
  350.  
  351.      BLED  has  10  configuration  parameters,  which  are  stored  in  the
  352.      configuration file BLED.CFG.   If no  configuration file  exists, BLED
  353.      uses as a default parameters suitable for QuickBASIC.
  354.  
  355.      (1)  Default extension for source files.  If no extension is given for
  356.           source files, BLED will  add this.   Default  for this  option is
  357.           BAS.  Source files include spec-1, and also spec-3 for merges and
  358.           spec-2 for file compares.
  359.  
  360.      (2)  Default extension for changes to  source.    If  no  extension is
  361.           given for this file, BLED will add this.  Default for this option
  362.           is MRG.  In merges, this  applies to  spec-2.   In file compares,
  363.           this applies to spec-3.
  364.  
  365.      (3)  Character using to begin remarks in source.  Default character is
  366.           the single quote (').    When  looking  for  a  line continuation
  367.           character at  the end  of a line, BLED will ignore all text after
  368.           the remark character.
  369.  
  370.      (4)  BLED phrase indicating end of  block.    Used  with  INSERT BLOCK
  371.           command.   What follows is a block of code to be inserted.  Tells
  372.           BLED where the code ends.
  373.  
  374.      (5)  Character beginning a line  of  BLED  documentation.    BLED will
  375.           completely  ignore  a  line  beginning  with  this character when
  376.           merging.  Allows comments or documentation  to be  included right
  377.           in a merge file to explain changes.  The character need not be in
  378.           column 1 - only the first non-blank character.   Default  is "*".
  379.           The  documentation  character  should  never  occur  as the first
  380.           character in your source text.
  381.  
  382.      (6)  Character at end of  every alphanumeric  label.   Default is ":".
  383.           BLED assumes  that line  labels occur only as the first word in a
  384.           line.  Leading spaces are ignored,  so that  labels can  begin in
  385.           any column.   This label character is used by BLED to help locate
  386.           labels.  When specifying blocks in a BLED  command, you  need not
  387.           include the  end-character.   BLED knows,  for example, what when
  388.           you say "LABEL LOOPER" that "LOOPER:" is what  actually occurs in
  389.           the source code.
  390.  
  391.      (7)  Character beginning  BLED commands.   Default  is none.  BLED can
  392.           distinguish its commands from source code lines by when a command
  393.           is needed and by key phrase.  If confusion might result, however,
  394.           you can specify that  BLED commands  begin with  a character that
  395.           will never  occur at  the beginning  of a  line of  text, such as
  396.           possibly "$" or "-".
  397.  
  398.      (8)  Whether case is ignored in alphanumeric labels.   Default is yes,
  399.           so that "looper" and "LOOPER" are treated as the same.
  400.  
  401.      (9)  Line continuation  character.  One way for a logical line to span
  402.           multiple physical lines is to insert a special  line continuation
  403.           character at  the end  of a  line that logically continues on the
  404.           following line.  Default is  "_"  (underscore).    May  differ in
  405.           languages other  than QuickBASIC.   Many other freeform languages
  406.           use  a  statement  terminator   character.      Fortran   puts  a
  407.           continuation  character  in  column  6, which is not supported by
  408.           BLED.  (BLED can still work on FORTRAN files though.)
  409.  
  410.      (10) File that warning messages  are written  to.   From the  time you
  411.           enter BLED  until you  exit DOS,  BLED may issue warning messages
  412.           based on its  file  comparison  or  merge.    These  messages are
  413.           written to  this file  for perusal  later.  This way BLED can run
  414.           completely batch with no  loss of  information.   You can nullify
  415.           these  messages  by  making  the  file "NUL:" or send them to the
  416.           screen using  "SCRN:".   BLED will  report the  number of warning
  417.           messages during  its operation.   Sending  messages to the screen
  418.           will interfere with BLED's normal report  of its  progress on the
  419.           screen.  The default name for this warning is "WARNING".
  420.  
  421.      (11) Maximum number of physical lines in a logical line.  There are
  422.           several functions that require BLED to hold an entire logical
  423.           line in memory before it can decide what to do with the line.
  424.           For example, a file compare requires BLED to determine whether
  425.           there has been any change anywhere in common line numbers.
  426.           There are only so many physical lines that BLED can hold in
  427.           memory from a master or transaction file.  The default is 400.
  428.           This parameter allows the user to increase that number.
  429.  
  430.      (12) Preserve BLED comment lines.  It is important to be able to
  431.           append notes to source code to explain changes.  These can
  432.           be left permanently in the code by making them source code
  433.           comments.  But often it is desired to leave comments in the
  434.           text only temporily.  The only facility for doing this in
  435.           versions of BLED prior to 1.5 was to include special BLED
  436.           comment lines in a merge file which would be stripped out when
  437.           a merge was done.
  438.               For people who prefer to work with the full
  439.           source code rather than merges, and then to do a BLED file
  440.           compare against the original version to produce a BLED merge,
  441.           the explanations of changes got stripped and there was no good
  442.           way to add in temporary comments while making changes.  The
  443.           parameter to preserve BLED comment lines remedies these problems.
  444.           It will cause BLED comment lines to be kept as a specially formatted
  445.           source code comment in a merge.  The BLED comment lines will be
  446.           "floated" up to the top of the line number and the BLED comment
  447.           symbol (* by default) will be replaced by the source code comment
  448.           symbol (' by default) followed by "<" with the BLED comment symbol
  449.           followed by ">".  For example, "* Corrects spelling of VARIABLE"
  450.           becomes "'<*> Corrects spelling of VARIABLE".
  451.               Conversely, this parameter will cause source code comments in
  452.           the proper format to be converted to BLED comment lines in a
  453.           file compare that produces a merge.  This allows programmers who
  454.           work directly with the full source to insert temporary comments.
  455.           For example, "'<*> Moved here from line 830" becomes "* Moved here
  456.           from line 830".  By running this BLED generated merge with this
  457.           option off, so that BLED comment lines are stripped, the temporary
  458.           commentary goes deleted.
  459.               The default for this parameter is "N", so that persons desiring
  460.           to preserve BLED comments must edit and save the configuration.
  461.  
  462.           
  463.      FILE COMPARE
  464.  
  465.      The function  of this module is to produce a BLED merge file that will
  466.      convert an old version of a file to a new, modified version.  All that
  467.      is in the merge are the necessary changes.  This is a very complex and
  468.      difficult programming task which is only partially implemented  in the
  469.      current version.   The  file comparison will only work for source with
  470.      line number labels.  Essentially,  the  assumption  is  that  the line
  471.      number labels  are ordered  from low  to high  in both versions of the
  472.      file.  A comparison utility must  have  some  way  to  identify lines.
  473.      Ideally, this  constraint should  be relaxed  to apply to alphanumeric
  474.      labels with no assumptions about order.  Please send me  your ideas or
  475.      code changes  if you  think you  can solve this problem.  So, the ONLY
  476.      TYPE OF MERGE FILE THAT FILE COMPARISON WILL  PRODUCE IS  ONE FOR LINE
  477.      MERGING, and not for general merging.
  478.  
  479.      Operationally, this  means that  if you  are not using line numbers in
  480.      your source code, you should make  your  code  changes  directly  in a
  481.      merge file, and apply the merge file to produce the modified code.  If
  482.      you directly change the old version, there will  be no  way to isolate
  483.      just the changes later.
  484.  
  485.      NOTE: the BLED file compare is NOT A GENERAL FILE COMPARE.  General
  486.      file compares, like the DOS utility, compare two files by relative
  487.      byte position with a file.  BLED does a logical line by logical
  488.      line compare.  Apply the BLED file compare ONLY TO COMPILEABLE SOURCE
  489.      CODE, otherwise the result will be unpredictable.
  490.  
  491.  
  492.      LINE MERGE
  493.  
  494.      This  option  is  a  generalization  of  the BASIC merge command.  The
  495.      assumptions are that
  496.  
  497.      o    the lines of code are numbered at the beginning of a line.
  498.  
  499.      o    Physical lines of text are to be blocked from a line number up to
  500.           the next  line number.  The merge operates only on such blocks as
  501.           a unit.
  502.  
  503.      o    The line numbers are ordered from low to high in  both the source
  504.           and merge file.
  505.  
  506.      o    Lines in  the source  not in the merge file are to be kept, lines
  507.           in the merge not in the source are to be  inserted, and  lines in
  508.           both are  to be  replaced by  the line  (i.e. block) in the merge
  509.           file.
  510.  
  511.      o    Lines in the merge file with only a line number are to be deleted
  512.           from the source file.
  513.  
  514.      o    The merge maintains the low to high line number order.
  515.  
  516.  
  517.      MERGE
  518.  
  519.      The general  merge in  BLED allows  merges even when there are no line
  520.      numbers.  The BLED  commands are  BLOCK, INSERT,  DELETE, REPLACE, and
  521.      KEEP.  Each of these commands can be abbreviated by their first letter
  522.      (e.g "B FROM LINE 1 TO LINE 5" means "BLOCK FROM LINE  1 TO  LINE 5").
  523.      The syntax is
  524.  
  525.      BLOCK [FROM] [linetype] lineid [TO/UPTO/THRU] [linetype] lineid
  526.      [block disposition] [lineid]
  527.  
  528.      where [linetype] is LINE/LABEL/LABEL#/STRING.
  529.  
  530.      The BLOCK  command is  for marking  a block of text in the source file
  531.      (spec-1).  It must specify where the block begins and ends.  The first
  532.      three phrases  after BLOCK  identify the beginning, the last three the
  533.      end.   All phrases  enclosed in  brackets are  optional.   LINE is the
  534.      default linetype if none is specified.
  535.  
  536.      Linetype has four options.
  537.  
  538.      o    LINE means the physical line number, either absolute or relative.
  539.  
  540.      The lineid  distinguishes the two.  Absolute line numbers are positive
  541.      integers, relative line numbers  are  "*+n",  where  n  is  a positive
  542.      integer.
  543.  
  544.      o    LABEL means an alphanumeric label.
  545.  
  546.      o    LABEL# means a numeric line label (a positive integer).
  547.  
  548.      o    STRING means a string of characters.
  549.  
  550.      LABELS must be the first word on a line, STRINGS can occur anywhere in
  551.      a line.
  552.  
  553.      Lineid matches with the  linetype.   LABEL and  STRING require  a word
  554.      with any  characters.   LABEL# requires  a positive integer.  And line
  555.      requires either a positive  integer, or  the string  "*+" to  mean the
  556.      current line  in the  text file  plus" a  positive number, or the word
  557.      "END" to indicate thru the end of file.
  558.  
  559.      The phrase TO and UPTO are  equivalent.    They  mean  up  to  but not
  560.      including.    The  phrase  THRU  means  up  to and include.  TO is the
  561.      default if no phrase is specified.
  562.  
  563.      There are  three block  dispositions: KEEP/DELETE/REPLACE.   They tell
  564.      BLED what  to do  with a  defined block  and therefor  make sense only
  565.      after a BLOCK command.  DELETE deletes the block, KEEP keeps it.
  566.  
  567.           REPLACE [BLOCK/n]
  568.  
  569.      This replaces a defined block with  another.   The "n"  means that the
  570.      next n  physical lines  go in  place of  the defined block.  And BLOCK
  571.      means that all following lines up  to  the  end-block  phrase  are the
  572.      replacements.
  573.  
  574.      Another BLED command is to insert new lines.
  575.  
  576.           INSERT [BLOCK/n]
  577.  
  578.      This means  to insert  a block of lines at the current position in the
  579.      source file, i.e. just  before the  current line  that has  been read.
  580.      The "n"  means to  insert the  following n  physical lines.  The BLOCK
  581.      means to take all following lines up to the end-block phrase.
  582.  
  583.      EXAMPLES
  584.  
  585.         (SOURCE)                           (MERGES)
  586.      CALL INITIALIZE              BLOCK FROM LINE 1 TO STRING OPENFILES
  587.      GOSUB OPENFILES              REPLACE 1
  588.      LOOPER:                      CALL HELP
  589.      IF X=1 THEN GOTO ALLDONE:    BLOCK FROM LINE * THRU LABEL ALLDONE 
  590.      X = X+1                      KEEP
  591.      GOTO LOOPER                  INSERT BLOCK
  592.      ALLDONE:                     CLOSE
  593.      END                          ENDBLOCK
  594.                       (RESULT)
  595.                    CALL HELP
  596.                    GOSUB OPENFILES
  597.                    LOOPER:
  598.                    IF X=1 THEN GOTO ALLDONE:
  599.                    X = X+1
  600.                    GOTO LOOPER
  601.                    ALLDONE:
  602.                    CLOSE
  603.                    END
  604.  
  605.               (SOURCE)                    (LINE MERGE)
  606.      110 IF GOT.COMMAND THEN_     115 NO.HELP = -1
  607.            IF NO.HELP THEN_       150 IF HELPFUL THEN_
  608.              PRINT "SORRY"              WHILE X>5 AND NOT EOF(2):_
  609.      120 GOSUB CHKFILES                   GOSUB CHECKER:_
  610.      150 IF HELPFUL THEN_               WEND
  611.             WHILE X>5:_           200
  612.               GOSUB CHECKER:_     220 END
  613.             WEND
  614.      200 IF X>10 THEN X=12
  615.  
  616.                          (RESULT)
  617.                   100 IF GOT.COMMAND THEN_
  618.                         IF NO.HELP THEN_
  619.                           PRINT "SORRY"
  620.                   115 NO.HELP = -1
  621.                   120 GOSUB CHKFILES
  622.                   150 IF HELPFUL THEN_
  623.                         WHILE X>5 AND NOT EOF(2):_
  624.                           GOSUB CHECKER:_
  625.                         WEND
  626.                   220 END
  627.  
  628.  
  629.      Stylistic Considerations
  630.  
  631.      A good merge file includes the following information at the top of the
  632.      file.
  633.  
  634.      o    author
  635.  
  636.      o    date of merge
  637.  
  638.      o    what merge is to be applied to
  639.  
  640.      o    how to apply the merge (line number merge, general merge?)
  641.  
  642.      o    a list of the general fixes or enhancements made, listed in order
  643.           of most to least important coupled.
  644.  
  645.      In the body of the merge the following documentation should be
  646.      included.
  647.  
  648.      o    a line by line explanation of the changes made stating what is
  649.           changed and why.  The explanation should precede the line.
  650.  
  651.      o    lines should be grouped together if they implement a common
  652.           function.
  653.  
  654.                           A Model Merge File
  655.  
  656.      ***************************************************************** 
  657.      *  EXAMPLE.MRG                                                  * 
  658.      *  by Ken Goosens   Jan 1, 1986                                 * 
  659.      *                                                               * 
  660.      *  to be applied to BLED.BAS version 1.1                        * 
  661.      *  using the general merge of BLED.EXE                          * 
  662.      *                                                               * 
  663.      *  This merge makes two changes:                                * 
  664.      *     (1) the defaults when no configuration exists are changed * 
  665.      *         to be appropriate for TURBO Pascal rather than        * 
  666.      *         QuickBASIC.                                           * 
  667.      *     (2) The warning message when no configuration file exists * 
  668.      *         is changed to beep and delay for 3 seconds rather     * 
  669.      *         than quietly and hurriedly display.                   * 
  670.      ***************************************************************** 
  671.       
  672.      * reset extensions for original and new files to "PAS" 
  673.       
  674.         BLOCK FROM LABEL USEDEFAULTS TO STRING ENDBLK 
  675.         REPLACE BLOCK 
  676.         USEDEFAULTS:      
  677.           DEORIGFILE$ = "PAS"  
  678.           DEBTCHCMDS$ = "MRG"  
  679.           DENEWFILE$  = "PAS"  
  680.         ENDBLOCK 
  681.       
  682.      * Change call from EXPLAIN to EXPERR 
  683.       
  684.      BLOCK FROM LABEL ERROPEN THRU STRING CALL 
  685.      REPLACE BLOCK 
  686.      ERROPEN:  
  687.         X$ = "Error"+STR$(ERR)+" opening file "+FF$  
  688.         CALL EXPERR (X$)  
  689.      ENDBLOCK 
  690.  
  691.  
  692.      How to Recompile BLED
  693.  
  694.      BLED is written in QuickBasic and is distributed with the source
  695.      code.  People wishing to modify or fix the source code can recompile
  696.      the code as follows.
  697.  
  698.      QB UTILBLED /G/O;
  699.      QB BLED ,,/G/O/X;
  700.      LINK BLED+UTILBLED,,NUL.MAP,advbas
  701.